<template>
	<view>
		<!--分类列表开始-->
		<view class="album_list">
			<navigator class="album_item" v-for="item in news" :key="item.id" :url="`/pages/list/index?id=${item.id}`">
				<view class="album_img">
					<image mode="aspectFill" :src="item.cover"></image>
				</view>
				<view class="album_info">
					<view class="album_name">{{item.name}}({{item.articleNumber}})</view>
				</view>
			</navigator>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				news: []
			}
		},
		mounted() {
			this.getList();
		},
		methods: {
			getList() {
				this.request({
					url: "https://bs.julywhj.cn/api/v1/app/channel/getList"
				}).then(res => {
					this.news = res.data
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.album_list {
		padding: 10rpx;

		.album_item {
			padding: 10rpx 0rpx;
			display: flex;
			border-bottom: 1rpx solid #C0C0C0;

			.album_img {
				flex: 1;
				padding: 10rpx;
				display: flex;
				justify-content: center;

				image {
					width: 160rpx;
					height: 160rpx;
				}
			}

			.album_info {
				flex: 2;
				padding: 10rpx;
				display: flex;
				align-items: center;

				.album_name {
					font-size: 30rpx;
					color: #000;
				}
			}
		}
	}
</style>
